package com.szholly.utils.spring.springmvc.route;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.servlet.HandlerExecutionChain;
import org.springframework.web.servlet.handler.AbstractHandlerMapping;

/**
 * 定义默认的/webroot/view下面的页面导航，规则如：index.do为/webroot/view下的index.html导航
 * 
 */
public class DefaultViewCustomHandlerMapping extends AbstractHandlerMapping {

	private DefaultViewRouteHandler formController;

	public DefaultViewCustomHandlerMapping() {
		formController = new DefaultViewRouteHandler();
	}

	@Override
	protected Object getHandlerInternal(HttpServletRequest request)
			throws Exception {
		HandlerExecutionChain chain = new HandlerExecutionChain(formController);
		return chain;
	}
}
